<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>[[ ${wxJsapiTransferPaymentPage.subject} ]]</title>
    <script type="application/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <script type="text/javascript" th:inline="javascript">
        function onBridgeReady() {
            WeixinJSBridge.invoke(
                'getBrandWCPayRequest',
                {
                    "appId": [[ ${wxJsapiTransferPaymentPage.appId} ]],
                    // 时间戳，自1970年以来的秒数
                    "timeStamp": [[ ${wxJsapiTransferPaymentPage.timeStamp} ]],
                    // 随机串
                    "nonceStr": [[ ${wxJsapiTransferPaymentPage.nonceStr} ]],
                    "package": [[ ${wxJsapiTransferPaymentPage.package} ]],
                    //微信签名方式：
                    "signType": [[ ${wxJsapiTransferPaymentPage.signType} ]],
                    //微信签名
                    "paySign": [[ ${wxJsapiTransferPaymentPage.paySign} ]]
                },
                function (res) {
                    if (res.err_msg === "get_brand_wcpay_request:ok") {
                        // 使用以上方式判断前端返回,微信团队郑重提示：
                        //res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠
                    }
                }
            );
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }

    </script>
</head>
<body>
<!-- 内容 -->
</body>
</html>